/******************************************************************************
* File description: SettingExport.qml
* Function: 设置-导出
* Current Version: 1.0.0
* Author: 张宇轩
* Date: 2024-08-30
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import QtGraphicalEffects 1.14

Item {
    id: root

    /* property 定义开始 */
    // 信号
    signal settingReturnSig()
    /* property 定义结束 */

    // 顶部导航栏
    TabbarNav {
        id: tabNav
        width: parent.width
        isEnable: true
        title: "导出设置"

        onReturnSig: {
            root.settingReturnSig()
            console.log("tabbar nav")
        }
        z: 999
    }

    ColumnLayout {
        anchors.fill: parent
        spacing: 0

        // 主体部分
        Rectangle {
            id: mainPart
            Layout.fillWidth: true
            Layout.preferredHeight: parent.height - btnContainer.height
            Layout.alignment: Qt.AlignTop

            // 背景
            Rectangle {
                anchors.fill: parent
                LinearGradient {
                    anchors.fill: parent
                    start: Qt.point(0, 0)
                    end: Qt.point(0, height)
                    gradient: Gradient {
                        GradientStop {position: 0.0; color: "#007BD8"}
                        GradientStop {position: 1.0; color: "#001A5A"}
                    }
                }
            }

            // 内容
            Rectangle {
                id: contentCon
                width: 600
                height: 330
                radius: 12
                color: "#C3FFFFFF"
                anchors.centerIn: parent

                ColumnLayout {
                    anchors.fill: parent
                    anchors.leftMargin: 40
                    anchors.rightMargin: 40
                    anchors.topMargin: 60
                    spacing: 25

                    Item {
                        Layout.fillWidth: true
                        Layout.preferredHeight: 40

                        // 默认文件导出路径
                        RowLayout {
                            anchors.fill: parent
                            spacing: 8

                            // 默认文件导出路径
                            LabelTextInput {
                                id: defaultExportPath
                                Layout.fillWidth: true
                                Layout.preferredHeight: 40
                                inputHeight: 40
                                labelText: "默认文件导出路径"
                                labelFontPixelSize: 16
                            }

                            // 选择路径按钮
                            PureImgButton {
                                id: pathSelector
                                Layout.preferredWidth: 120
                                Layout.preferredHeight: 40
                                pureText: "选择路径"
                                pureIconPath: "qrc:/icons/upload.svg"
                            }
                        }

                    }

                    Item {
                        Layout.fillWidth: true
                        Layout.preferredHeight: 40

                        // 默认文件导出方式
                        RowLayout {
                            anchors.fill: parent
                            spacing: 8

                            // 默认文件导出方式
                            Label {
                                id: defaultExportType
                                font.pixelSize: 16
                                color: "#FF222222"
                                text: "默认文件导出方式"
                            }

                            CustomCheckBox {
                                id: defaultExportTypeCheckBox
                                checkBoxText: "自动导出"
                            }

                            CustomHorSpacerItem {}
                        }
                    }

                    Item {
                        Layout.fillWidth: true
                        Layout.fillHeight: true

                        ColumnLayout {
                            anchors.fill: parent

                            // 注
                            Item {
                                id: zhuCon

                                Label {
                                    id: star
                                    anchors.left: parent.left
                                    color: "red"
                                    font.pixelSize: 14
                                    text: "*"
                                }

                                Label {
                                    id: zhu
                                    anchors.left: star.right
                                    color: "#FF222222"
                                    font.pixelSize: 14
                                    text: "注："
                                }

                                Label {
                                    anchors.left: zhu.right
                                    color: "#FF222222"
                                    font.pixelSize: 14
                                    text: "导出报告可选择本地和网络路径，自动导出即实验完成后自动导出报告到上面路径下"
                                    clip: true
                                    wrapMode: Text.Wrap
                                }
                            }

                            CustomHorSpacerItem {}
                        }
                    }
                }
            }
        }

        // 按钮部分
        Rectangle {
            id: btnContainer
            Layout.fillWidth: true
            Layout.preferredHeight: 80

            RowLayout {
                height: parent.height
                anchors.rightMargin: 16
                anchors.right: parent.right

                PureButton {
                    id: canceledBtn
                    pureText: "取消(C)"
                    Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
                }

                GradientButton {
                    id: nextBtn
                    gradText: "保存(N)"
                    Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
                }
            }
        }
    }

}
